{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-09-04T08:38:29.247681Z",
     "start_time": "2019-09-04T08:38:29.017279Z"
    },
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>记录数</th>\n",
       "      <th>合作方</th>\n",
       "      <th>地市</th>\n",
       "      <th>完成时间</th>\n",
       "      <th>总竣工人数</th>\n",
       "      <th>用户类型</th>\n",
       "      <th>省份</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHONGAN</td>\n",
       "      <td>武汉市</td>\n",
       "      <td>201808</td>\n",
       "      <td>6470</td>\n",
       "      <td>1</td>\n",
       "      <td>湖北省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>MASHANGXIAOJIN</td>\n",
       "      <td>连云港市</td>\n",
       "      <td>201907</td>\n",
       "      <td>2310</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>淄博市</td>\n",
       "      <td>201810</td>\n",
       "      <td>1268</td>\n",
       "      <td>2</td>\n",
       "      <td>山东省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>GUOFU</td>\n",
       "      <td>济南市</td>\n",
       "      <td>201902</td>\n",
       "      <td>163</td>\n",
       "      <td>1</td>\n",
       "      <td>山东省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>MASHANGXIAOJIN</td>\n",
       "      <td>安康市</td>\n",
       "      <td>201907</td>\n",
       "      <td>503</td>\n",
       "      <td>2</td>\n",
       "      <td>陕西省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>广州市</td>\n",
       "      <td>201904</td>\n",
       "      <td>746</td>\n",
       "      <td>2</td>\n",
       "      <td>广东省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>1</td>\n",
       "      <td>DUMIAO</td>\n",
       "      <td>呼和浩特市</td>\n",
       "      <td>201710</td>\n",
       "      <td>27</td>\n",
       "      <td>2</td>\n",
       "      <td>内蒙古自治区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>文昌市</td>\n",
       "      <td>201903</td>\n",
       "      <td>531</td>\n",
       "      <td>2</td>\n",
       "      <td>海南省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>1</td>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>娄底市</td>\n",
       "      <td>201901</td>\n",
       "      <td>320</td>\n",
       "      <td>2</td>\n",
       "      <td>湖南省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1</td>\n",
       "      <td>FENQICHAOREN</td>\n",
       "      <td>天门市</td>\n",
       "      <td>201811</td>\n",
       "      <td>27</td>\n",
       "      <td>2</td>\n",
       "      <td>湖北省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>1</td>\n",
       "      <td>TIANCHENGRONGZU</td>\n",
       "      <td>衡水市</td>\n",
       "      <td>201907</td>\n",
       "      <td>502</td>\n",
       "      <td>1</td>\n",
       "      <td>河北省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>1</td>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>河池市</td>\n",
       "      <td>201904</td>\n",
       "      <td>34</td>\n",
       "      <td>2</td>\n",
       "      <td>广西壮族自治区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHONGAN</td>\n",
       "      <td>庆阳市</td>\n",
       "      <td>201804</td>\n",
       "      <td>600</td>\n",
       "      <td>1</td>\n",
       "      <td>甘肃省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHONGAN</td>\n",
       "      <td>运城市</td>\n",
       "      <td>201801</td>\n",
       "      <td>476</td>\n",
       "      <td>1</td>\n",
       "      <td>山西省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHONGAN</td>\n",
       "      <td>荆州市</td>\n",
       "      <td>201901</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>湖北省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>雅安地区</td>\n",
       "      <td>201807</td>\n",
       "      <td>47</td>\n",
       "      <td>2</td>\n",
       "      <td>四川省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>眉山市</td>\n",
       "      <td>201812</td>\n",
       "      <td>114</td>\n",
       "      <td>2</td>\n",
       "      <td>四川省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>1</td>\n",
       "      <td>DUMIAO</td>\n",
       "      <td>舟山市</td>\n",
       "      <td>201801</td>\n",
       "      <td>268</td>\n",
       "      <td>2</td>\n",
       "      <td>浙江省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>1</td>\n",
       "      <td>GUOFU</td>\n",
       "      <td>贺州市</td>\n",
       "      <td>201902</td>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>广西壮族自治区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>1</td>\n",
       "      <td>ZIYING</td>\n",
       "      <td>佳木斯市</td>\n",
       "      <td>201808</td>\n",
       "      <td>17</td>\n",
       "      <td>1</td>\n",
       "      <td>黑龙江省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>1</td>\n",
       "      <td>ZIYING</td>\n",
       "      <td>河池市</td>\n",
       "      <td>201808</td>\n",
       "      <td>58</td>\n",
       "      <td>1</td>\n",
       "      <td>广西壮族自治区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>1</td>\n",
       "      <td>MASHANGXIAOJIN</td>\n",
       "      <td>芜湖市</td>\n",
       "      <td>201908</td>\n",
       "      <td>24</td>\n",
       "      <td>2</td>\n",
       "      <td>安徽省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHONGAN</td>\n",
       "      <td>焦作市</td>\n",
       "      <td>201812</td>\n",
       "      <td>20</td>\n",
       "      <td>1</td>\n",
       "      <td>河南省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHONGAN</td>\n",
       "      <td>广元市</td>\n",
       "      <td>201806</td>\n",
       "      <td>15</td>\n",
       "      <td>1</td>\n",
       "      <td>四川省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>1</td>\n",
       "      <td>ZIYING</td>\n",
       "      <td>铜陵市</td>\n",
       "      <td>201902</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>安徽省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>1</td>\n",
       "      <td>GUOFU</td>\n",
       "      <td>楚雄彝族自治州</td>\n",
       "      <td>201907</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>云南省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>1</td>\n",
       "      <td>ZIYING</td>\n",
       "      <td>齐齐哈尔市</td>\n",
       "      <td>201810</td>\n",
       "      <td>24</td>\n",
       "      <td>1</td>\n",
       "      <td>黑龙江省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHONGAN</td>\n",
       "      <td>鹤壁市</td>\n",
       "      <td>201812</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>河南省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>1</td>\n",
       "      <td>ZIYING</td>\n",
       "      <td>南昌市</td>\n",
       "      <td>201805</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>江西省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>1</td>\n",
       "      <td>ZIYING</td>\n",
       "      <td>昆明市</td>\n",
       "      <td>201805</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>云南省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21386</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHONGAN</td>\n",
       "      <td>遵义市</td>\n",
       "      <td>201809</td>\n",
       "      <td>1673</td>\n",
       "      <td>1</td>\n",
       "      <td>贵州省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21387</th>\n",
       "      <td>1</td>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>佛山市</td>\n",
       "      <td>201903</td>\n",
       "      <td>956</td>\n",
       "      <td>2</td>\n",
       "      <td>广东省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21388</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHONGAN</td>\n",
       "      <td>随州市</td>\n",
       "      <td>201801</td>\n",
       "      <td>560</td>\n",
       "      <td>1</td>\n",
       "      <td>湖北省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21389</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>石家庄市</td>\n",
       "      <td>201809</td>\n",
       "      <td>1662</td>\n",
       "      <td>2</td>\n",
       "      <td>河北省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21390</th>\n",
       "      <td>1</td>\n",
       "      <td>MASHANGXIAOJIN</td>\n",
       "      <td>内江市</td>\n",
       "      <td>201902</td>\n",
       "      <td>1189</td>\n",
       "      <td>2</td>\n",
       "      <td>四川省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21391</th>\n",
       "      <td>1</td>\n",
       "      <td>MASHANGXIAOJIN</td>\n",
       "      <td>乐山市</td>\n",
       "      <td>201903</td>\n",
       "      <td>595</td>\n",
       "      <td>2</td>\n",
       "      <td>四川省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21392</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHONGAN</td>\n",
       "      <td>东莞市</td>\n",
       "      <td>201802</td>\n",
       "      <td>1121</td>\n",
       "      <td>1</td>\n",
       "      <td>广东省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21393</th>\n",
       "      <td>1</td>\n",
       "      <td>DUMIAO</td>\n",
       "      <td>攀枝花市</td>\n",
       "      <td>201907</td>\n",
       "      <td>224</td>\n",
       "      <td>2</td>\n",
       "      <td>四川省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21394</th>\n",
       "      <td>1</td>\n",
       "      <td>ZIYING</td>\n",
       "      <td>景德镇市</td>\n",
       "      <td>201810</td>\n",
       "      <td>206</td>\n",
       "      <td>1</td>\n",
       "      <td>江西省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21395</th>\n",
       "      <td>1</td>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>潍坊市</td>\n",
       "      <td>201811</td>\n",
       "      <td>32</td>\n",
       "      <td>2</td>\n",
       "      <td>山东省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21396</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>邢台市</td>\n",
       "      <td>201807</td>\n",
       "      <td>117</td>\n",
       "      <td>2</td>\n",
       "      <td>河北省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21397</th>\n",
       "      <td>1</td>\n",
       "      <td>GUOFU</td>\n",
       "      <td>十堰市</td>\n",
       "      <td>201812</td>\n",
       "      <td>326</td>\n",
       "      <td>1</td>\n",
       "      <td>湖北省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21398</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>九江市</td>\n",
       "      <td>201803</td>\n",
       "      <td>128</td>\n",
       "      <td>2</td>\n",
       "      <td>江西省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21399</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHONGAN</td>\n",
       "      <td>大理白族自治州</td>\n",
       "      <td>201811</td>\n",
       "      <td>439</td>\n",
       "      <td>1</td>\n",
       "      <td>云南省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21400</th>\n",
       "      <td>1</td>\n",
       "      <td>ZIYING</td>\n",
       "      <td>安庆市</td>\n",
       "      <td>201802</td>\n",
       "      <td>43</td>\n",
       "      <td>1</td>\n",
       "      <td>安徽省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21401</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>忻州市</td>\n",
       "      <td>201903</td>\n",
       "      <td>170</td>\n",
       "      <td>2</td>\n",
       "      <td>山西省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21402</th>\n",
       "      <td>1</td>\n",
       "      <td>ZIYING</td>\n",
       "      <td>泰州市</td>\n",
       "      <td>201810</td>\n",
       "      <td>50</td>\n",
       "      <td>1</td>\n",
       "      <td>江苏省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21403</th>\n",
       "      <td>1</td>\n",
       "      <td>ZIYING</td>\n",
       "      <td>兴安盟</td>\n",
       "      <td>201903</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "      <td>内蒙古自治区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21404</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>阳泉市</td>\n",
       "      <td>201811</td>\n",
       "      <td>69</td>\n",
       "      <td>2</td>\n",
       "      <td>山西省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21405</th>\n",
       "      <td>1</td>\n",
       "      <td>MASHANGXIAOJIN</td>\n",
       "      <td>甘孜藏族自治州</td>\n",
       "      <td>201908</td>\n",
       "      <td>16</td>\n",
       "      <td>2</td>\n",
       "      <td>四川省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21406</th>\n",
       "      <td>1</td>\n",
       "      <td>DUMIAO</td>\n",
       "      <td>廊坊市</td>\n",
       "      <td>201905</td>\n",
       "      <td>55</td>\n",
       "      <td>2</td>\n",
       "      <td>河北省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21407</th>\n",
       "      <td>1</td>\n",
       "      <td>ZIYING</td>\n",
       "      <td>乐山市</td>\n",
       "      <td>201711</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>四川省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21408</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>汕头市</td>\n",
       "      <td>201806</td>\n",
       "      <td>57</td>\n",
       "      <td>2</td>\n",
       "      <td>广东省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21409</th>\n",
       "      <td>1</td>\n",
       "      <td>DUMIAO</td>\n",
       "      <td>克拉玛依市</td>\n",
       "      <td>201808</td>\n",
       "      <td>83</td>\n",
       "      <td>2</td>\n",
       "      <td>新疆维吾尔自治区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21410</th>\n",
       "      <td>1</td>\n",
       "      <td>ZIYING</td>\n",
       "      <td>滁州市</td>\n",
       "      <td>201809</td>\n",
       "      <td>22</td>\n",
       "      <td>1</td>\n",
       "      <td>安徽省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21411</th>\n",
       "      <td>1</td>\n",
       "      <td>GUOFU</td>\n",
       "      <td>蚌埠市</td>\n",
       "      <td>201903</td>\n",
       "      <td>27</td>\n",
       "      <td>1</td>\n",
       "      <td>安徽省</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21412</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHONGAN</td>\n",
       "      <td>兴安盟</td>\n",
       "      <td>201901</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>内蒙古自治区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21413</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHONGAN</td>\n",
       "      <td>鄂尔多斯市</td>\n",
       "      <td>201805</td>\n",
       "      <td>18</td>\n",
       "      <td>1</td>\n",
       "      <td>内蒙古自治区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21414</th>\n",
       "      <td>1</td>\n",
       "      <td>ZIYING</td>\n",
       "      <td>喀什地区</td>\n",
       "      <td>201807</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>新疆维吾尔自治区</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21415</th>\n",
       "      <td>1</td>\n",
       "      <td>ZHONGAN</td>\n",
       "      <td>莱芜市</td>\n",
       "      <td>201808</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>山东省</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>21416 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       记录数              合作方       地市    完成时间  总竣工人数  用户类型        省份\n",
       "0        1          ZHONGAN      武汉市  201808   6470     1       湖北省\n",
       "1        1   MASHANGXIAOJIN     连云港市  201907   2310     2       江苏省\n",
       "2        1         ZHAOLIAN      淄博市  201810   1268     2       山东省\n",
       "3        1            GUOFU      济南市  201902    163     1       山东省\n",
       "4        1   MASHANGXIAOJIN      安康市  201907    503     2       陕西省\n",
       "5        1         ZHAOLIAN      广州市  201904    746     2       广东省\n",
       "6        1           DUMIAO    呼和浩特市  201710     27     2    内蒙古自治区\n",
       "7        1         ZHAOLIAN      文昌市  201903    531     2       海南省\n",
       "8        1           WEIXIN      娄底市  201901    320     2       湖南省\n",
       "9        1     FENQICHAOREN      天门市  201811     27     2       湖北省\n",
       "10       1  TIANCHENGRONGZU      衡水市  201907    502     1       河北省\n",
       "11       1           WEIXIN      河池市  201904     34     2   广西壮族自治区\n",
       "12       1          ZHONGAN      庆阳市  201804    600     1       甘肃省\n",
       "13       1          ZHONGAN      运城市  201801    476     1       山西省\n",
       "14       1          ZHONGAN      荆州市  201901      6     1       湖北省\n",
       "15       1         ZHAOLIAN     雅安地区  201807     47     2       四川省\n",
       "16       1         ZHAOLIAN      眉山市  201812    114     2       四川省\n",
       "17       1           DUMIAO      舟山市  201801    268     2       浙江省\n",
       "18       1            GUOFU      贺州市  201902     61     1   广西壮族自治区\n",
       "19       1           ZIYING     佳木斯市  201808     17     1      黑龙江省\n",
       "20       1           ZIYING      河池市  201808     58     1   广西壮族自治区\n",
       "21       1   MASHANGXIAOJIN      芜湖市  201908     24     2       安徽省\n",
       "22       1          ZHONGAN      焦作市  201812     20     1       河南省\n",
       "23       1          ZHONGAN      广元市  201806     15     1       四川省\n",
       "24       1           ZIYING      铜陵市  201902      2     1       安徽省\n",
       "25       1            GUOFU  楚雄彝族自治州  201907      4     1       云南省\n",
       "26       1           ZIYING    齐齐哈尔市  201810     24     1      黑龙江省\n",
       "27       1          ZHONGAN      鹤壁市  201812      2     1       河南省\n",
       "28       1           ZIYING      南昌市  201805      5     1       江西省\n",
       "29       1           ZIYING      昆明市  201805      3     1       云南省\n",
       "...    ...              ...      ...     ...    ...   ...       ...\n",
       "21386    1          ZHONGAN      遵义市  201809   1673     1       贵州省\n",
       "21387    1           WEIXIN      佛山市  201903    956     2       广东省\n",
       "21388    1          ZHONGAN      随州市  201801    560     1       湖北省\n",
       "21389    1         ZHAOLIAN     石家庄市  201809   1662     2       河北省\n",
       "21390    1   MASHANGXIAOJIN      内江市  201902   1189     2       四川省\n",
       "21391    1   MASHANGXIAOJIN      乐山市  201903    595     2       四川省\n",
       "21392    1          ZHONGAN      东莞市  201802   1121     1       广东省\n",
       "21393    1           DUMIAO     攀枝花市  201907    224     2       四川省\n",
       "21394    1           ZIYING     景德镇市  201810    206     1       江西省\n",
       "21395    1           WEIXIN      潍坊市  201811     32     2       山东省\n",
       "21396    1         ZHAOLIAN      邢台市  201807    117     2       河北省\n",
       "21397    1            GUOFU      十堰市  201812    326     1       湖北省\n",
       "21398    1         ZHAOLIAN      九江市  201803    128     2       江西省\n",
       "21399    1          ZHONGAN  大理白族自治州  201811    439     1       云南省\n",
       "21400    1           ZIYING      安庆市  201802     43     1       安徽省\n",
       "21401    1         ZHAOLIAN      忻州市  201903    170     2       山西省\n",
       "21402    1           ZIYING      泰州市  201810     50     1       江苏省\n",
       "21403    1           ZIYING      兴安盟  201903     13     1    内蒙古自治区\n",
       "21404    1         ZHAOLIAN      阳泉市  201811     69     2       山西省\n",
       "21405    1   MASHANGXIAOJIN  甘孜藏族自治州  201908     16     2       四川省\n",
       "21406    1           DUMIAO      廊坊市  201905     55     2       河北省\n",
       "21407    1           ZIYING      乐山市  201711      3     1       四川省\n",
       "21408    1         ZHAOLIAN      汕头市  201806     57     2       广东省\n",
       "21409    1           DUMIAO    克拉玛依市  201808     83     2  新疆维吾尔自治区\n",
       "21410    1           ZIYING      滁州市  201809     22     1       安徽省\n",
       "21411    1            GUOFU      蚌埠市  201903     27     1       安徽省\n",
       "21412    1          ZHONGAN      兴安盟  201901      1     1    内蒙古自治区\n",
       "21413    1          ZHONGAN    鄂尔多斯市  201805     18     1    内蒙古自治区\n",
       "21414    1           ZIYING     喀什地区  201807      5     1  新疆维吾尔自治区\n",
       "21415    1          ZHONGAN      莱芜市  201808      7     1       山东省\n",
       "\n",
       "[21416 rows x 7 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 导入百融csv文件\n",
    "import pandas as pd\n",
    "import os\n",
    "os.chdir(r'D:\\vintage处理')\n",
    "df=pd.read_csv('vintage总人数.csv',low_memory=False)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-09-04T08:41:39.297139Z",
     "start_time": "2019-09-04T08:40:44.581400Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "success!\n"
     ]
    }
   ],
   "source": [
    "# last = pd.DataFrame(columns=('合作方','用户类型','省份','完成时间','账期','MOB','放款金额'))\n",
    "users     = []\n",
    "types     = []\n",
    "provinces = []\n",
    "city = []\n",
    "# operator  = []\n",
    "time      = []\n",
    "billing   = []\n",
    "mob       = []\n",
    "num       = []\n",
    "# money     = []\n",
    "# 遍历df每一行\n",
    "for i,r in df.iterrows():\n",
    "\n",
    "    y = 201908 - r['完成时间']\n",
    "    if y >= 189:\n",
    "        z = y - 176\n",
    "    elif y >= 89:\n",
    "        z = y - 88\n",
    "    else:\n",
    "        z = y\n",
    "    j = 1\n",
    "    while j <= z:\n",
    "        \n",
    "        month = int(str(r['完成时间'])[4:])\n",
    "        if month + j <=12:\n",
    "            b_month = r['完成时间'] + j\n",
    "        elif month + j > 12 and month + j <=24:\n",
    "            b_month = r['完成时间'] + j + 88\n",
    "        elif month + j > 24:\n",
    "            b_month = r['完成时间'] + j + 176\n",
    "\n",
    "        \n",
    "        users.append(r['合作方'])\n",
    "        types.append(r['用户类型'])\n",
    "        provinces.append(r['省份'])\n",
    "#         operator.append(r['运营商'])\n",
    "        city.append(r['地市'])\n",
    "        time.append(r['完成时间'])\n",
    "        billing.append(b_month)\n",
    "        mob.append(j)\n",
    "        num.append(r['总竣工人数'])\n",
    "\n",
    "#         last = last.append(x,ignore_index=True,sort=False)\n",
    "#         last = pd.concat([last,x],ignore_index=True,sort=False)\n",
    "        j += 1\n",
    "data = {\n",
    "    '合作方': users,\n",
    "    '用户类型': types,\n",
    "    '省份': provinces,\n",
    "    '地市': city,\n",
    "    '完成时间': time,\n",
    "    '账期': billing,\n",
    "    'MOB': mob,\n",
    "    '总竣工人数': num\n",
    "}\n",
    "last = pd.DataFrame(data)\n",
    "last.to_excel('success.xlsx',index=False)\n",
    "print('success!')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
